﻿	      <?php include("conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
	public $fulse;

	function __construct($fulse)
	{
		$this->fulse      = $fulse;
	}
}



	$prize = array();
	
 if($_REQUEST[userid]!="")
 {         
 $state=1;
          $rert31=mysql_query("select *from collect where  goodsid ='".$_REQUEST[goodsid]."' and userid ='".$_REQUEST[userid]."'");
$rowf2=mysql_fetch_array($rert31);
    if($rowf2==true)
	{
	$der=200;
	}
	else
	{

$srat=mysql_query("INSERT INTO collect(userid,goodsid) VALUES ('$_REQUEST[userid]','$_REQUEST[goodsid]')");
	  


		  $der=100;
		  
		 
			
		}
		
		}
		 else
		  {
		   $der=300;
		  }

$prize[] = new MyPrizeBean($der);
echo json_encode($prize);


?>